Skip to content

Fix Hub token reserve location for post-AHM XCM transfers#5

Open
rockbmb wants to merge 2 commits into
galacticcouncil:polkadot-stable2506from
rockbmb:basilisk-xtokens-reserve-fix
Open

Fix Hub token reserve location for post-AHM XCM transfers#5
rockbmb wants to merge 2 commits into
galacticcouncil:polkadot-stable2506from
rockbmb:basilisk-xtokens-reserve-fix

Conversation

@rockbmb
Copy link
Copy Markdown

@rockbmb rockbmb commented Mar 9, 2026

Problem

In the Basilisk runtime, the KSM token's reserve is set to Location::parent(); this is relative to itself, meaning it refers to the relay chain.
See:

impl Parse for Location {
fn chain_part(&self) -> Option<Location> {
match (self.parents, self.first_interior()) {
// sibling parachain
(1, Some(Parachain(id))) => Some(Location::new(1, [Parachain(*id)])),
// parent
(1, _) => Some(Location::parent()),
// children parachain
(0, Some(Parachain(id))) => Some(Location::new(0, [Parachain(*id)])),
_ => None,
}

Post-AHM, the reserve is Asset Hub, i.e. parachain 1000. This breaks horizontal KSM token transfers, as xTokens incorrectly routes through the relay instead of AH.

Changes

  • chain_part(): (1, _)Location::new(1, [Parachain(1000)]) instead of Location::parent()

  • AbsoluteReserveProvider/RelativeReserveProvider moved from orml_traits::location to orml_xtokens

    • this is a breaking change
  • Added ASSET_HUB_ID = 1000 constant in traits/src/location.rs

  • Mock tests updated: Asset Hub parachain added; relay trusts AH for teleports

Based on open-web3-stack#1033. open-web3-stack#1035.

Validation

Validated with Polkadot Ecosystem Tests (basilisk.karura.xcm suite).

  1. Current behavior: Basilisk -> Karura transfer of KSM produced empty HRMP messages, zero balance on the destination chain, Karura

    • Note how Karura -> Basilisk transfers of KSM work
  2. Behavior with this patch: after building the Basilisk runtime with its ORML dependencies patched to this PR's branch and running PET with BASILISK_WASM override, the Basilisk -> Karura KSM transfer worked.

Reproducing with PET

  1. Patch the ORML dependencies in the Basilisk repo to point to this PR's branch
  2. Build the Basilisk runtime:
    cargo build --release -p basilisk-runtime
  3. Clone PET and install deps:
    git clone https://github.com/AcalaNetwork/polkadot-ecosystem-tests
    cd polkadot-ecosystem-tests && yarn install
  4. Run with wasm override:
    BASILISK_WASM=/path/to/basilisk_runtime.compact.compressed.wasm yarn test basilisk.karura.xcm

@rockbmb
Copy link
Copy Markdown
Author

rockbmb commented Mar 9, 2026

I made this PR to the polkadot-stable2506 branch, as it is the one that Basilisk uses.

Let me know if this PR is helpful or not 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant